/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
/**
 * 
 * If you have edited the file, please update
 * all the last-modified fields manually. Thanks!
 *
 * @last-modified by: 
 * @last-modified date: 
 * @last-modified time: 
 *
 * @author Swee Zhi
 * @date-created Oct 25, 2011    @time-created 4:03:03 PM
 *
 * @project: 
 * @module: 
 * @institution: 
 *
 */
package util.enumhelper;

import util.enumeration.Language;
import util.enumeration.Time24H;

public class LocalizedTime24H {
    // alphabetical order
    public static String getLocalizedTime24HAsString(Time24H time24H, String locale) {
        String localizedTime24H = "";
        
        // en_US ENGLISH, UNITED STATES
        if (locale.equals(SupportedLocale.getSupportedLocaleStringByLanguage(Language.ENGLISH_US))) {
            localizedTime24H = getTime24H_EN_US(time24H);
        }
        // en_SG ENGLISH, SINGAPORE
        else
        if (locale.equals(SupportedLocale.getSupportedLocaleStringByLanguage(Language.ENGLISH_SINGAPORE))) {
            localizedTime24H = getTime24H_EN_SG(time24H);
        }
        // ms_MY MALAY, MALAYSIA
        else
        if (locale.equals(SupportedLocale.getSupportedLocaleStringByLanguage(Language.MALAY))) {
            localizedTime24H = getTime24H_MS_MY(time24H);
        }
        
        // zh_CN CHINESE, CHINA
        else
        if (locale.equals(SupportedLocale.getSupportedLocaleStringByLanguage(Language.CHINESE_CHINA))) {
            localizedTime24H = getTime24H_ZH_CN(time24H);
        }
        // other language...
        else {
            localizedTime24H = getTime24H_EN_US(time24H);
        }
        
        return localizedTime24H;
    }
    
  // simplified chinese (zh_CN)
    private static String getTime24H_ZH_CN(Time24H time24H) {
        String localizedTime24H = "";
        
        switch (time24H) {
            case ZERO: localizedTime24H = "00:00" ; break;
            case ONE: localizedTime24H = "01:00"; break;
            case TWO: localizedTime24H = "02:00"; break;
            case THREE: localizedTime24H = "03:00"; break;
            case FOUR: localizedTime24H = "04:00"; break;
            case FIVE: localizedTime24H = "05:00"; break;
            case SIX: localizedTime24H = "06:00"; break;
            case SEVEN: localizedTime24H = "07:00"; break;
            case EIGHT: localizedTime24H = "08:00"; break;
            case NINE: localizedTime24H = "09:00"; break;
            case TEN: localizedTime24H = "10:00"; break;
            case ELEVEN: localizedTime24H = "11:00"; break;
            case TWELVE: localizedTime24H = "12:00"; break;
            case THIRTEEN: localizedTime24H = "13:00"; break;
            case FOURTEEN: localizedTime24H = "14:00"; break;
            case FIFTEEN: localizedTime24H = "15:00" ; break;
            case SIXTEEN: localizedTime24H = "16:00"; break;
            case SEVENTEEN: localizedTime24H = "17:00"; break;
            case EIGHTEEN: localizedTime24H = "18:00"; break;
            case NINETEEN: localizedTime24H = "19:00"; break;
            case TWENTY: localizedTime24H = "20:00"; break;
            case TWENTY_ONE: localizedTime24H = "21:00"; break;
            case TWENTY_TWO: localizedTime24H = "22:00"; break;
            case TWENTY_THREE: localizedTime24H = "23:00"; break;
         }
        return localizedTime24H;
    }
    
    // default (en_US)
    private static String getTime24H_EN_US(Time24H time24H) {
        String localizedTime24H = "";
        
        switch (time24H) {
            case ZERO: localizedTime24H = "00:00" ; break;
            case ONE: localizedTime24H = "01:00"; break;
            case TWO: localizedTime24H = "02:00"; break;
            case THREE: localizedTime24H = "03:00"; break;
            case FOUR: localizedTime24H = "04:00"; break;
            case FIVE: localizedTime24H = "05:00"; break;
            case SIX: localizedTime24H = "06:00"; break;
            case SEVEN: localizedTime24H = "07:00"; break;
            case EIGHT: localizedTime24H = "08:00"; break;
            case NINE: localizedTime24H = "09:00"; break;
            case TEN: localizedTime24H = "10:00"; break;
            case ELEVEN: localizedTime24H = "11:00"; break;
            case TWELVE: localizedTime24H = "12:00"; break;
            case THIRTEEN: localizedTime24H = "13:00"; break;
            case FOURTEEN: localizedTime24H = "14:00"; break;
            case FIFTEEN: localizedTime24H = "15:00" ; break;
            case SIXTEEN: localizedTime24H = "16:00"; break;
            case SEVENTEEN: localizedTime24H = "17:00"; break;
            case EIGHTEEN: localizedTime24H = "18:00"; break;
            case NINETEEN: localizedTime24H = "19:00"; break;
            case TWENTY: localizedTime24H = "20:00"; break;
            case TWENTY_ONE: localizedTime24H = "21:00"; break;
            case TWENTY_TWO: localizedTime24H = "22:00"; break;
            case TWENTY_THREE: localizedTime24H = "23:00"; break;
         }
        return localizedTime24H;
    }
    
    // singapore english (en_SG)
    private static String getTime24H_EN_SG(Time24H time24H) {
        String localizedTime24H = "";
        
        switch (time24H) {
            case ZERO: localizedTime24H = "00:00" ; break;
            case ONE: localizedTime24H = "01:00"; break;
            case TWO: localizedTime24H = "02:00"; break;
            case THREE: localizedTime24H = "03:00"; break;
            case FOUR: localizedTime24H = "04:00"; break;
            case FIVE: localizedTime24H = "05:00"; break;
            case SIX: localizedTime24H = "06:00"; break;
            case SEVEN: localizedTime24H = "07:00"; break;
            case EIGHT: localizedTime24H = "08:00"; break;
            case NINE: localizedTime24H = "09:00"; break;
            case TEN: localizedTime24H = "10:00"; break;
            case ELEVEN: localizedTime24H = "11:00"; break;
            case TWELVE: localizedTime24H = "12:00"; break;
            case THIRTEEN: localizedTime24H = "13:00"; break;
            case FOURTEEN: localizedTime24H = "14:00"; break;
            case FIFTEEN: localizedTime24H = "15:00" ; break;
            case SIXTEEN: localizedTime24H = "16:00"; break;
            case SEVENTEEN: localizedTime24H = "17:00"; break;
            case EIGHTEEN: localizedTime24H = "18:00"; break;
            case NINETEEN: localizedTime24H = "19:00"; break;
            case TWENTY: localizedTime24H = "20:00"; break;
            case TWENTY_ONE: localizedTime24H = "21:00"; break;
            case TWENTY_TWO: localizedTime24H = "22:00"; break;
            case TWENTY_THREE: localizedTime24H = "23:00"; break;
         }
        return localizedTime24H;
    }
    
    // bahasa malaysia (ms_MY)
    private static String getTime24H_MS_MY(Time24H time24H) {
        String localizedTime24H = "";
        
        switch (time24H) {
            case ZERO: localizedTime24H = "00:00" ; break;
            case ONE: localizedTime24H = "01:00"; break;
            case TWO: localizedTime24H = "02:00"; break;
            case THREE: localizedTime24H = "03:00"; break;
            case FOUR: localizedTime24H = "04:00"; break;
            case FIVE: localizedTime24H = "05:00"; break;
            case SIX: localizedTime24H = "06:00"; break;
            case SEVEN: localizedTime24H = "07:00"; break;
            case EIGHT: localizedTime24H = "08:00"; break;
            case NINE: localizedTime24H = "09:00"; break;
            case TEN: localizedTime24H = "10:00"; break;
            case ELEVEN: localizedTime24H = "11:00"; break;
            case TWELVE: localizedTime24H = "12:00"; break;
            case THIRTEEN: localizedTime24H = "13:00"; break;
            case FOURTEEN: localizedTime24H = "14:00"; break;
            case FIFTEEN: localizedTime24H = "15:00" ; break;
            case SIXTEEN: localizedTime24H = "16:00"; break;
            case SEVENTEEN: localizedTime24H = "17:00"; break;
            case EIGHTEEN: localizedTime24H = "18:00"; break;
            case NINETEEN: localizedTime24H = "19:00"; break;
            case TWENTY: localizedTime24H = "20:00"; break;
            case TWENTY_ONE: localizedTime24H = "21:00"; break;
            case TWENTY_TWO: localizedTime24H = "22:00"; break;
            case TWENTY_THREE: localizedTime24H = "23:00"; break;
        }
        return localizedTime24H;
    }
}
